/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * JFrame_Contact.java
 *
 * Created on 16-06-2009, 16:46:33
 */

package doanlythuyet_javaoutlook.MyUserControl;

import BUS.MyContactBUS;
import DTO.MyAttachDTO;
import DTO.MyContactDTO;
import doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp;
import doanlythuyet_javaoutlook.EventListener_ClickChuotVaoCayDuyetFile;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.Image;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.filechooser.FileNameExtensionFilter;

/**
 *
 * @author ShineShiao
 */
public class JFrame_Contact extends javax.swing.JFrame {
    private ArrayList<String> cacMailDangChon;
    public void duaDTOLenHienThiChiTiet(MyContactDTO contactDTO){
        jTextField_Address.setText(contactDTO.getM_DiaChi());
        jTextField_Company.setText(contactDTO.getM_CongTy());
        jTextField_Email.setText(contactDTO.getM_Email());
        jTextField_Fullname.setText(contactDTO.getM_Ten());
        jTextField_NickName.setText(contactDTO.getM_NickName());
        jTextField_PhoneNumber.setText(contactDTO.getM_DiaChi());
        //jTextField_Address.setText(contactDTO.getM_DiaChi());
        String imDir = DoAnLyThuyet_JavaOutLookApp.getCurdir() + contactDTO.getM_Hinh();
        loadAnhLenFrame(imDir);

    }
    private jTable_HienThiContact conClass_Table = new jTable_HienThiContact();
    private void initMyComponents() throws IOException, SQLException{
        //conClass_Table.DuaDanhSachMailVaoBang(new ArrayList<MyContactDTO>(0));
        jScrollPane1.setViewportView(conClass_Table);
        conClass_Table.refreshBang();
        conClass_Table.addEventListener_ClickChuotVaoCayDuyetFile(new EventListener_ClickChuotVaoCayDuyetFile() {

            public void Event_ClickChuotVaoCayDuyetFile_Occurred(String str_fileduocchon) {
                try {
                    //throw new UnsupportedOperationException("Not supported yet.");
                    //JOptionPane.showMessageDialog(null, str_fileduocchon);
                    duaDTOLenHienThiChiTiet(new MyContactBUS().layTatCaContactBangID(str_fileduocchon));
                    jButton_Luu.setToolTipText(str_fileduocchon);
                } catch (SQLException ex) {
                    Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
                } catch (IOException ex) {
                    Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }
    /** Creates new form JFrame_Contact */
    public JFrame_Contact() throws IOException, SQLException {
        initComponents();
        initMyComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jToolBar1 = new javax.swing.JToolBar();
        jButton_New = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel2 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextField_Fullname = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jTextField_NickName = new javax.swing.JTextField();
        jTextField_PhoneNumber = new javax.swing.JTextField();
        jTextField_Address = new javax.swing.JTextField();
        jTextField_Company = new javax.swing.JTextField();
        jTextField_Email = new javax.swing.JTextField();
        jPanel_Image = new javax.swing.JPanel();
        jLabel_Image = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton_TimAnh = new javax.swing.JButton();
        jButton_Luu = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jRadioButton5 = new javax.swing.JRadioButton();
        jPanel4 = new javax.swing.JPanel();
        jButton_GoiMail = new javax.swing.JButton();
        jButton_Xoa = new javax.swing.JButton();
        jButton_Xoa3 = new javax.swing.JButton();
        menuBar = new javax.swing.JMenuBar();
        javax.swing.JMenu fileMenu = new javax.swing.JMenu();
        jMenu_New = new javax.swing.JMenu();
        jMenuItem_Mail = new javax.swing.JMenuItem();
        jMenuItem_Contact = new javax.swing.JMenuItem();
        jMenuItem_Task = new javax.swing.JMenuItem();
        jMenuItem_Folder = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuItem_Save = new javax.swing.JMenuItem();
        jMenuItem_SaveAs = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jSeparator5 = new javax.swing.JSeparator();
        jMenuItem_delete = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JSeparator();
        javax.swing.JMenuItem jMenuItem_Close = new javax.swing.JMenuItem();
        jMenu_Edit = new javax.swing.JMenu();
        jMenuItem_Cut = new javax.swing.JMenuItem();
        jMenuItem_Copy = new javax.swing.JMenuItem();
        jMenuItem_Paste = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JSeparator();
        jMenuItem_SelectAll = new javax.swing.JMenuItem();
        jSeparator4 = new javax.swing.JSeparator();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenu_Tools = new javax.swing.JMenu();
        jMenuItem_Find = new javax.swing.JMenuItem();
        javax.swing.JMenu helpMenu = new javax.swing.JMenu();
        javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setName("Form"); // NOI18N

        jToolBar1.setRollover(true);
        jToolBar1.setName("jToolBar1"); // NOI18N

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp.class).getContext().getResourceMap(JFrame_Contact.class);
        jButton_New.setText(resourceMap.getString("jButton_New.text")); // NOI18N
        jButton_New.setFocusable(false);
        jButton_New.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButton_New.setName("jButton_New"); // NOI18N
        jButton_New.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jToolBar1.add(jButton_New);

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel1.border.title"))); // NOI18N
        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 868, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 392, Short.MAX_VALUE)
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel2.border.title"))); // NOI18N
        jPanel2.setName("jPanel2"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jTextField_Fullname.setText(resourceMap.getString("jTextField_Fullname.text")); // NOI18N
        jTextField_Fullname.setName("jTextField_Fullname"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jTextField_NickName.setText(resourceMap.getString("jTextField_NickName.text")); // NOI18N
        jTextField_NickName.setName("jTextField_NickName"); // NOI18N

        jTextField_PhoneNumber.setText(resourceMap.getString("jTextField_PhoneNumber.text")); // NOI18N
        jTextField_PhoneNumber.setName("jTextField_PhoneNumber"); // NOI18N

        jTextField_Address.setText(resourceMap.getString("jTextField_Address.text")); // NOI18N
        jTextField_Address.setName("jTextField_Address"); // NOI18N

        jTextField_Company.setText(resourceMap.getString("jTextField_Company.text")); // NOI18N
        jTextField_Company.setName("jTextField_Company"); // NOI18N

        jTextField_Email.setText(resourceMap.getString("jTextField_Email.text")); // NOI18N
        jTextField_Email.setName("jTextField_Email"); // NOI18N

        jPanel_Image.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jPanel_Image.setName("jPanel_Image"); // NOI18N

        jLabel_Image.setText(resourceMap.getString("jLabel_Image.text")); // NOI18N
        jLabel_Image.setName("jLabel_Image"); // NOI18N

        javax.swing.GroupLayout jPanel_ImageLayout = new javax.swing.GroupLayout(jPanel_Image);
        jPanel_Image.setLayout(jPanel_ImageLayout);
        jPanel_ImageLayout.setHorizontalGroup(
            jPanel_ImageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel_Image, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        jPanel_ImageLayout.setVerticalGroup(
            jPanel_ImageLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel_Image, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton_TimAnh.setText(resourceMap.getString("jButton_TimAnh.text")); // NOI18N
        jButton_TimAnh.setName("jButton_TimAnh"); // NOI18N
        jButton_TimAnh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_TimAnhActionPerformed(evt);
            }
        });

        jButton_Luu.setText(resourceMap.getString("jButton_Luu.text")); // NOI18N
        jButton_Luu.setName("jButton_Luu"); // NOI18N
        jButton_Luu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_LuuActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton_Luu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton_TimAnh, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 37, Short.MAX_VALUE)
                .addComponent(jPanel_Image, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jTextField_Company)
                    .addComponent(jTextField_PhoneNumber)
                    .addComponent(jTextField_Fullname, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 98, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(7, 7, 7))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(29, 29, 29)))
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField_Address, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField_Email, javax.swing.GroupLayout.DEFAULT_SIZE, 199, Short.MAX_VALUE))
                    .addComponent(jTextField_NickName, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_NickName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(20, 20, 20)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_Address, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_Email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_Fullname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addGap(20, 20, 20)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_PhoneNumber, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField_Company, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addComponent(jButton_TimAnh)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                .addComponent(jButton_Luu)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1))
            .addComponent(jPanel_Image, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel3.border.title"))); // NOI18N
        jPanel3.setName("jPanel3"); // NOI18N

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setSelected(true);
        jRadioButton1.setText(resourceMap.getString("jRadioButton1.text")); // NOI18N
        jRadioButton1.setName("jRadioButton1"); // NOI18N
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setText(resourceMap.getString("jRadioButton2.text")); // NOI18N
        jRadioButton2.setName("jRadioButton2"); // NOI18N
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton5);
        jRadioButton5.setText(resourceMap.getString("jRadioButton5.text")); // NOI18N
        jRadioButton5.setName("jRadioButton5"); // NOI18N
        jRadioButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioButton1)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jRadioButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioButton5)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jRadioButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton2)
                    .addComponent(jRadioButton5)))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel4.border.title"))); // NOI18N
        jPanel4.setName("jPanel4"); // NOI18N

        jButton_GoiMail.setText(resourceMap.getString("jButton_GoiMail.text")); // NOI18N
        jButton_GoiMail.setName("jButton_GoiMail"); // NOI18N
        jButton_GoiMail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_GoiMailActionPerformed(evt);
            }
        });

        jButton_Xoa.setText(resourceMap.getString("jButton_Xoa.text")); // NOI18N
        jButton_Xoa.setName("jButton_Xoa"); // NOI18N
        jButton_Xoa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_XoaActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addComponent(jButton_GoiMail, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Xoa))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jButton_GoiMail)
                .addComponent(jButton_Xoa))
        );

        jButton_Xoa3.setText(resourceMap.getString("jButton_Xoa3.text")); // NOI18N
        jButton_Xoa3.setName("jButton_Xoa3"); // NOI18N
        jButton_Xoa3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_Xoa3ActionPerformed(evt);
            }
        });

        menuBar.setName("menuBar"); // NOI18N

        fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
        fileMenu.setName("fileMenu"); // NOI18N

        jMenu_New.setText(resourceMap.getString("jMenu_New.text")); // NOI18N
        jMenu_New.setName("jMenu_New"); // NOI18N

        jMenuItem_Mail.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Mail.setText(resourceMap.getString("jMenuItem_Mail.text")); // NOI18N
        jMenuItem_Mail.setName("jMenuItem_Mail"); // NOI18N
        jMenu_New.add(jMenuItem_Mail);

        jMenuItem_Contact.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Contact.setText(resourceMap.getString("jMenuItem_Contact.text")); // NOI18N
        jMenuItem_Contact.setName("jMenuItem_Contact"); // NOI18N
        jMenu_New.add(jMenuItem_Contact);

        jMenuItem_Task.setText(resourceMap.getString("jMenuItem_Task.text")); // NOI18N
        jMenuItem_Task.setName("jMenuItem_Task"); // NOI18N
        jMenu_New.add(jMenuItem_Task);

        jMenuItem_Folder.setText(resourceMap.getString("jMenuItem_Folder.text")); // NOI18N
        jMenuItem_Folder.setName("jMenuItem_Folder"); // NOI18N
        jMenu_New.add(jMenuItem_Folder);

        fileMenu.add(jMenu_New);

        jSeparator1.setName("jSeparator1"); // NOI18N
        fileMenu.add(jSeparator1);

        jMenuItem_Save.setText(resourceMap.getString("jMenuItem_Save.text")); // NOI18N
        jMenuItem_Save.setName("jMenuItem_Save"); // NOI18N
        fileMenu.add(jMenuItem_Save);

        jMenuItem_SaveAs.setText(resourceMap.getString("jMenuItem_SaveAs.text")); // NOI18N
        jMenuItem_SaveAs.setName("jMenuItem_SaveAs"); // NOI18N
        fileMenu.add(jMenuItem_SaveAs);

        jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
        jMenuItem2.setName("jMenuItem2"); // NOI18N
        fileMenu.add(jMenuItem2);

        jSeparator5.setName("jSeparator5"); // NOI18N
        fileMenu.add(jSeparator5);

        jMenuItem_delete.setText(resourceMap.getString("jMenuItem_delete.text")); // NOI18N
        jMenuItem_delete.setName("jMenuItem_delete"); // NOI18N
        fileMenu.add(jMenuItem_delete);

        jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
        jMenuItem3.setName("jMenuItem3"); // NOI18N
        fileMenu.add(jMenuItem3);

        jSeparator2.setName("jSeparator2"); // NOI18N
        fileMenu.add(jSeparator2);

        javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(doanlythuyet_javaoutlook.DoAnLyThuyet_JavaOutLookApp.class).getContext().getActionMap(JFrame_Contact.class, this);
        jMenuItem_Close.setAction(actionMap.get("quit")); // NOI18N
        jMenuItem_Close.setText(resourceMap.getString("jMenuItem_Close.text")); // NOI18N
        jMenuItem_Close.setName("jMenuItem_Close"); // NOI18N
        fileMenu.add(jMenuItem_Close);

        menuBar.add(fileMenu);

        jMenu_Edit.setText(resourceMap.getString("jMenu_Edit.text")); // NOI18N
        jMenu_Edit.setName("jMenu_Edit"); // NOI18N

        jMenuItem_Cut.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Cut.setText(resourceMap.getString("jMenuItem_Cut.text")); // NOI18N
        jMenuItem_Cut.setName("jMenuItem_Cut"); // NOI18N
        jMenu_Edit.add(jMenuItem_Cut);

        jMenuItem_Copy.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Copy.setText(resourceMap.getString("jMenuItem_Copy.text")); // NOI18N
        jMenuItem_Copy.setName("jMenuItem_Copy"); // NOI18N
        jMenu_Edit.add(jMenuItem_Copy);

        jMenuItem_Paste.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK));
        jMenuItem_Paste.setText(resourceMap.getString("jMenuItem_Paste.text")); // NOI18N
        jMenuItem_Paste.setName("jMenuItem_Paste"); // NOI18N
        jMenu_Edit.add(jMenuItem_Paste);

        jSeparator3.setName("jSeparator3"); // NOI18N
        jMenu_Edit.add(jSeparator3);

        jMenuItem_SelectAll.setText(resourceMap.getString("jMenuItem_SelectAll.text")); // NOI18N
        jMenuItem_SelectAll.setName("jMenuItem_SelectAll"); // NOI18N
        jMenu_Edit.add(jMenuItem_SelectAll);

        jSeparator4.setName("jSeparator4"); // NOI18N
        jMenu_Edit.add(jSeparator4);

        jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
        jMenuItem1.setName("jMenuItem1"); // NOI18N
        jMenu_Edit.add(jMenuItem1);

        menuBar.add(jMenu_Edit);

        jMenu_Tools.setText(resourceMap.getString("jMenu_Tools.text")); // NOI18N
        jMenu_Tools.setName("jMenu_Tools"); // NOI18N

        jMenuItem_Find.setText(resourceMap.getString("jMenuItem_Find.text")); // NOI18N
        jMenuItem_Find.setName("jMenuItem_Find"); // NOI18N
        jMenu_Tools.add(jMenuItem_Find);

        menuBar.add(jMenu_Tools);

        helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
        helpMenu.setName("helpMenu"); // NOI18N

        aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
        aboutMenuItem.setName("aboutMenuItem"); // NOI18N
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 894, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(749, 749, 749)
                        .addComponent(jButton_Xoa3, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton_Xoa3)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents


    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        try {
            // TODO add your handling code here:
            MyContactDTO contactDTO = taoDTOTuInputNguoiDung();
            if (jLabel_Image.getToolTipText() != null){
                String reDir = "\\ContactItems\\" + new Date().getTime() + ".mim";
                File dir = new File(DoAnLyThuyet_JavaOutLookApp.getCurdir() + "\\ContactItems\\");
                if (!(dir.exists())){
                    dir.mkdirs();
                }
                copyfile (jLabel_Image.getToolTipText(), DoAnLyThuyet_JavaOutLookApp.getCurdir() + reDir);
                contactDTO.setM_Hinh(reDir);
            }
            int newId = new MyContactBUS().themContact(contactDTO);
            if (newId != -1){
                JOptionPane.showMessageDialog(null, "Thêm thành công contactID: " + newId);
                conClass_Table.refreshBang();
            }
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jButton1ActionPerformed

    /**
     * load anh len khunh hinh tren frame
     * @param filePath  duong dan tuong doi file anh
     */
    private void loadAnhLenFrame(String filePath){
        if (new File(filePath).exists()){
            ImageIcon icon = new ImageIcon(filePath);
            icon.setImage(icon.getImage().getScaledInstance(jLabel_Image.getWidth(), jLabel_Image.getHeight(), Image.SCALE_SMOOTH));
            jLabel_Image.setToolTipText(filePath);
            jLabel_Image.setIcon(icon);
        }
        else {
            jLabel_Image.setToolTipText(null);
            jLabel_Image.setIcon(null);
        }
    }
    private void jButton_TimAnhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_TimAnhActionPerformed
        try {
            // TODO add your handling code here:
            File file = moDialogChonAnh();
            if (file != null) {
                loadAnhLenFrame(file.getCanonicalPath());
            }
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }

}//GEN-LAST:event_jButton_TimAnhActionPerformed

    public static void copyfile(String srFile, String dtFile) throws FileNotFoundException, IOException{
        try{
          File f1 = new File(srFile);
          File f2 = new File(dtFile);
          InputStream in = new FileInputStream(f1);

          //For Append the file.
    //      OutputStream out = new FileOutputStream(f2,true);

          //For Overwrite the file.
          OutputStream out = new FileOutputStream(f2);

          byte[] buf = new byte[1024];
          int len;
          while ((len = in.read(buf)) > 0){
            out.write(buf, 0, len);
          }
          in.close();
          out.close();
        }
        catch(FileNotFoundException ex){
          System.out.println(ex.getMessage() + " in the specified directory.");
          System.exit(0);
        }
        catch(IOException e){
          System.out.println(e.getMessage());
        }
     }
    /**
     * mo dialog cho phep chon anh
     * @return  file duoc chon
     */
    public File moDialogChonAnh()
    {
        File Kq = null;
        JFileChooser fileChooser = new JFileChooser();
        fileChooser.addChoosableFileFilter(new FileNameExtensionFilter("image files (*.png, *.jpeg)", "png", "jpeg", "jpg"));
        fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
        fileChooser.setMultiSelectionEnabled(false);
        fileChooser.setCurrentDirectory(new File("."));
        int ketQuaShowOpenDialog = fileChooser.showOpenDialog(null);
        if (ketQuaShowOpenDialog == JFileChooser.APPROVE_OPTION){
            //fileChooser.getf
            Kq = fileChooser.getSelectedFile();
        }
        return Kq;
    }
    private void jButton_XoaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_XoaActionPerformed
        // TODO add your handling code here:
        ArrayList<Integer> cacIdDuocChon = LayCacIdMailDuocChon();
        for (Integer i : cacIdDuocChon){
            try {
                new MyContactBUS().xoaContact(i);
            } catch (IOException ex) {
                Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        conClass_Table.refreshBang();
}//GEN-LAST:event_jButton_XoaActionPerformed

    private void jButton_LuuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_LuuActionPerformed
        try {
            // TODO add your handling code here:
            String Kq = "";
            if (capNhatContact() == 1){
                Kq = "Cap nhat thanh cong!";
                conClass_Table.refreshBang();
            }
            else
                Kq = "Cap nhat that bai!";
            JOptionPane.showMessageDialog(null, Kq);
        } catch (SQLException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }

}//GEN-LAST:event_jButton_LuuActionPerformed

    private void jRadioButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton5ActionPerformed
        try {
            // TODO add your handling code here:
            ArrayList<MyContactDTO> conDTOs = new MyContactBUS().layTatCaContact();
            //jScrollPane1.removeAll();
            GridLayout layout = new GridLayout(0, 3);
            layout.setHgap(20);
            layout.setVgap(20);
            JPanel panel = new JPanel(layout);
            for (MyContactDTO con : conDTOs){
                JPanel_BusCard busCard = new JPanel_BusCard();
                busCard.HienThiThongTin(con.getM_Id());
                panel.add(busCard);
            }
            jScrollPane1.setViewportView(panel);
            //busCard.set
        } catch (SQLException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }
        //busCard.set
    }//GEN-LAST:event_jRadioButton5ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
        try {
            // TODO add your handling code here:
            ArrayList<MyContactDTO> conDTOs = new MyContactBUS().layTatCaContact();
            //jScrollPane1.removeAll();
            GridLayout layout = new GridLayout(0, 3);
            layout.setHgap(20);
            layout.setVgap(20);
            JPanel panel = new JPanel(layout);
            for (MyContactDTO con : conDTOs){
                JPanel_AddCard addCard = new JPanel_AddCard();
                addCard.HienThiThongTin(con.getM_Id());
                panel.add(addCard);
            }
            jScrollPane1.setViewportView(panel);
            //busCard.set
        } catch (SQLException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jButton_GoiMailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_GoiMailActionPerformed
        // TODO add your handling code here:
        setCacMailDangChon(LayCacEMailDuocChon());

        JFrame_GuiMail guiMail = new JFrame_GuiMail();
        guiMail.getJTextField_to().setText(getCacMailDangChon().get(0));
        String cc = "";
        for (int i = 1; i < getCacMailDangChon().size(); i++){
            cc += getCacMailDangChon().get(i) + ",";
        }
        guiMail.getJTextField_cc().setText(cc);

        //dispose();
        //guiMail.getJTextField_to().sett
}//GEN-LAST:event_jButton_GoiMailActionPerformed

    private void jButton_Xoa3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_Xoa3ActionPerformed
        // TODO add your handling code here:
        dispose();
    }//GEN-LAST:event_jButton_Xoa3ActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        try {
            // TODO add your handling code here:
            initMyComponents();
        } catch (IOException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        } catch (SQLException ex) {
            Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jRadioButton1ActionPerformed
    public int capNhatContact () throws SQLException, IOException{
        MyContactBUS contactBUS = new MyContactBUS();
        MyContactDTO contactDTO = taoDTOTuInputNguoiDung();
        contactDTO.setM_Id(Integer.parseInt(jButton_Luu.getToolTipText()));
        File file = new File (DoAnLyThuyet_JavaOutLookApp.getCurdir() + contactDTO.getM_Hinh());
        if (jLabel_Image.getToolTipText() != null && !file.equals(new File(jLabel_Image.getToolTipText()))){
            if (file.exists()){
                file.delete();
                copyfile(jLabel_Image.getToolTipText(), file.getAbsolutePath());
            }
            else{
                String reDir = "\\ContactItems\\" + new Date().getTime() + ".mim";
                File dir = new File(DoAnLyThuyet_JavaOutLookApp.getCurdir() + "\\ContactItems\\");
                if (!(dir.exists())){
                    dir.mkdirs();
                }
                copyfile (jLabel_Image.getToolTipText(), DoAnLyThuyet_JavaOutLookApp.getCurdir() + reDir);
                contactDTO.setM_Hinh(reDir);
            }
        }
        return contactBUS.capNhatContact(contactDTO);
    }
    public ArrayList<Integer> LayCacIdMailDuocChon (){
        ArrayList<Integer> Kq = new ArrayList<Integer>();
        for (int i = 0; i < conClass_Table.getRowCount(); i++)
            if (conClass_Table.getValueAt(i, 0) != null && (Boolean)conClass_Table.getValueAt(i, 0))
                Kq.add(Integer.parseInt(conClass_Table.getValueAt(i, conClass_Table.getColumnCount() - 1).toString()));
        return Kq;
    }

    public ArrayList<String> LayCacEMailDuocChon (){
        ArrayList<String> Kq = new ArrayList<String>();
        for (int i = 0; i < conClass_Table.getRowCount(); i++)
            if (conClass_Table.getValueAt(i, 0) != null && (Boolean)conClass_Table.getValueAt(i, 0)
            && conClass_Table.getValueAt(i, 3) != null)
                Kq.add(conClass_Table.getValueAt(i, 3).toString());
        return Kq;
    }
    private MyContactDTO taoDTOTuInputNguoiDung(){
        MyContactDTO Kq = new MyContactDTO();
        Kq.setM_CongTy(jTextField_Company.getText());
        Kq.setM_DiaChi(jTextField_Address.getText());
        Kq.setM_Email(jTextField_Email.getText());
        Kq.setM_Ten(jTextField_Fullname.getText());
        Kq.setM_NickName(jTextField_NickName.getText());
        Kq.setM_DienThoai(jTextField_PhoneNumber.getText());
        return Kq;
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new JFrame_Contact().setVisible(true);
                } catch (IOException ex) {
                    Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
                } catch (SQLException ex) {
                    Logger.getLogger(JFrame_Contact.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton_GoiMail;
    private javax.swing.JButton jButton_Luu;
    private javax.swing.JButton jButton_New;
    private javax.swing.JButton jButton_TimAnh;
    private javax.swing.JButton jButton_Xoa;
    private javax.swing.JButton jButton_Xoa3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel_Image;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem_Contact;
    private javax.swing.JMenuItem jMenuItem_Copy;
    private javax.swing.JMenuItem jMenuItem_Cut;
    private javax.swing.JMenuItem jMenuItem_Find;
    private javax.swing.JMenuItem jMenuItem_Folder;
    private javax.swing.JMenuItem jMenuItem_Mail;
    private javax.swing.JMenuItem jMenuItem_Paste;
    private javax.swing.JMenuItem jMenuItem_Save;
    private javax.swing.JMenuItem jMenuItem_SaveAs;
    private javax.swing.JMenuItem jMenuItem_SelectAll;
    private javax.swing.JMenuItem jMenuItem_Task;
    private javax.swing.JMenuItem jMenuItem_delete;
    private javax.swing.JMenu jMenu_Edit;
    private javax.swing.JMenu jMenu_New;
    private javax.swing.JMenu jMenu_Tools;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel_Image;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JTextField jTextField_Address;
    private javax.swing.JTextField jTextField_Company;
    private javax.swing.JTextField jTextField_Email;
    private javax.swing.JTextField jTextField_Fullname;
    private javax.swing.JTextField jTextField_NickName;
    private javax.swing.JTextField jTextField_PhoneNumber;
    private javax.swing.JToolBar jToolBar1;
    private javax.swing.JMenuBar menuBar;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the jButton_GoiMail
     */
    public javax.swing.JButton getJButton_GoiMail() {
        return jButton_GoiMail;
    }

    /**
     * @param jButton_GoiMail the jButton_GoiMail to set
     */
    public void setJButton_GoiMail(javax.swing.JButton jButton_GoiMail) {
        this.jButton_GoiMail = jButton_GoiMail;
    }

    /**
     * @return the cacMailDangChon
     */
    public ArrayList<String> getCacMailDangChon() {
        return cacMailDangChon;
    }

    /**
     * @param cacMailDangChon the cacMailDangChon to set
     */
    public void setCacMailDangChon(ArrayList<String> cacMailDangChon) {
        this.cacMailDangChon = cacMailDangChon;
    }

}
